import xml.etree.ElementTree as tree

from os import path as p

path = r'{}AppSets.xml'.format(p.dirname(__file__).split('utils')[0])


def get_xml_value(key):
    try:
        root = tree.parse(path).getroot()
        if root:
            find = root.find(key)
            return (
                find.get('key', None),
                find.get('value', None)
            )
    except Exception as e:
        print('{}'.format(e))
    return None
